/**
 * @description Model Manifest
 *
 * @author Xiongmao
 */

var db = require('../db');

module.exports = db.model('Apply', {
    tableName: 'applys',
    hasTimestamps: true,
    creator() {
        return this.belongsTo('User', 'creator');
    },
    leader() {
        return this.belongsTo('User', 'leader_id');
    },
    parent() {
        return this.belongsTo('Type', 'parent_id');
    },

    types() {
        return this.belongsTo('Type', 'type_id');
    },
    customer() {
        return this.belongsTo('Customer', 'customer_id');
    }
});
